<?php

use App\Api\UploadController;
use App\Front\AppealController;
use App\Front\CarouselController;
use App\Front\ConsultationController;
use App\Front\GeotherController;
use App\Front\NoticeController;
use App\Front\PolicyController;
use App\Front\ReportController;
use App\Front\SignController;
use App\Front\VillageController;
use App\Front\WechatController;

Route::prefix('wxapi')->middleware(['auth:sanctum'])->group(function () {

//行政村
    Route::get("village", [VillageController::class, 'index']);

//退出登录
    Route::post('logout', [WechatController::class, 'logout']);

// 政策咨询
    Route::get('consultation/query', [ConsultationController::class, 'currUserConsultation']);
    Route::post("consultation", [ConsultationController::class, 'store']);
    Route::get('consultation', [ConsultationController::class, 'index']);

    Route::get('consultation/{consultation}', [ConsultationController::class, 'show']);
    Route::post('consultation/{consultation}/reply', [ConsultationController::class, 'reply']);


// 反应诉求

    Route::get('appeal/query', [AppealController::class, 'currUserAppeal']);
    Route::post("appeal", [AppealController::class, 'store']);
    Route::get('appeal', [AppealController::class, 'index']);
    Route::get('appeal/{appeal}', [AppealController::class, 'show']);
    Route::post('appeal/{appeal}/reply', [AppealController::class, 'reply']);


// 举报干部
    Route::get('report/query', [ReportController::class, 'currUserreport']);
    Route::post("report", [ReportController::class, 'store']);
    Route::get('report', [ReportController::class, 'index']);
    Route::get('report/{report}', [ReportController::class, 'show']);
    Route::post('report/{report}/reply', [ReportController::class, 'reply']);


    //待处理未处理汇总
    Route::get("deals", [GeotherController::class, 'deals']);

    Route::get("perVillageTodo", [GeotherController::class, 'perVillageTodo']);
    Route::get("perVillageDone", [GeotherController::class, 'perVillageDone']);

    // 按村统计
    Route::post("sortByVillage", [GeotherController::class, 'sortByVillage']);

    //修改个人信息
    Route::post("updateInfo", [WechatController::class, 'updateInfo']);
});

//与微信服务器通信的接口
Route::any('wxapi/authwechat', [WechatController::class, 'authWechat']);


//通过微信获取手机号接口
Route::any("wxapi/getPhoneNumber", [WechatController::class, 'getPhoneNumber']);

Route::post('wxapi/login', [WechatController::class, 'login']);

//上传接口
Route::post('wxapi/wxupload/image', [UploadController::class, 'wxUpload']);

//    政策列表
Route::get("wxapi/policy", [PolicyController::class, 'index']);

Route::get("wxapi/policy/{policy}", [PolicyController::class, 'show']);

//    轮播图
Route::get('wxapi/carousel', [CarouselController::class, 'index']);

//    公告
Route::get("wxapi/notice", [NoticeController::class, 'index']);


